package com.sanpu.kxe.module.dialog;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.sanpu.kxe.R;
import com.sanpu.kxe.base.BaseDialog;
import com.sanpu.kxe.common.interfaces.DialogViewListener;
import com.sanpu.kxe.module.roundview.RoundTextView;

import butterknife.ButterKnife;

/**
 * Description：未实名弹框
 * Created by 薛勇军 on 2019/9/29.
 */

public class CertificateDialog extends BaseDialog<CertificateDialog> {

    private RoundTextView vCcomfirmRtv;
    private TextView vClose;

    private DialogViewListener mListener;

    public CertificateDialog(Context context) {
        super(context);
    }

    public CertificateDialog(Context context, DialogViewListener listener) {
        super(context);
        this.mListener = listener;
    }

    @Override
    public View onCreateView() {
        showAnim(new BaseAnimatorSet() {
            @Override
            public void setAnimation(View view) {

            }
        });
        View inflate = View.inflate(getContext(), R.layout.dialog_certificate, null);
        vCcomfirmRtv = ButterKnife.findById(inflate, R.id.comfirmRtv);
        vClose = ButterKnife.findById(inflate, R.id.close);
        setCanceledOnTouchOutside(false);
        setCancelable(false);
        return inflate;
    }

    @Override
    public void setUiBeforShow() {
        vClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mListener != null) {
                    mListener.btnLeftCancel();
                }
                dismiss();
            }
        });
        vCcomfirmRtv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mListener != null) {
                    mListener.btnRightConfirm();
                }
                dismiss();
            }
        });
    }
}
